Imports NWN2Toolset
Public Class nwn2_oc_conversation
    Implements NWN2Toolset.Plugins.INWN2Plugin

    Private WithEvents menu As TD.SandBar.MenuButtonItem
    Private bInit As Boolean = True

    Public ReadOnly Property DisplayName() As String Implements NWN2Toolset.Plugins.INWN2Plugin.DisplayName
        Get
            Return "Conversation Converter"
        End Get
    End Property

    Public Sub Load(ByVal cHost As NWN2Toolset.Plugins.INWN2PluginHost) Implements NWN2Toolset.Plugins.INWN2Plugin.Load

    End Sub

    Public ReadOnly Property MenuName() As String Implements NWN2Toolset.Plugins.INWN2Plugin.MenuName
        Get
            Return "Conversation Converter"
        End Get
    End Property

    Public ReadOnly Property Name() As String Implements NWN2Toolset.Plugins.INWN2Plugin.Name
        Get
            Return "ConversationConverter"
        End Get
    End Property

    Public Property Preferences() As Object Implements NWN2Toolset.Plugins.INWN2Plugin.Preferences
        Get
            Return Nothing
        End Get
        Set(ByVal value As Object)

        End Set
    End Property

    Public Sub Shutdown(ByVal cHost As NWN2Toolset.Plugins.INWN2PluginHost) Implements NWN2Toolset.Plugins.INWN2Plugin.Shutdown

    End Sub

    Public Sub Startup(ByVal cHost As NWN2Toolset.Plugins.INWN2PluginHost) Implements NWN2Toolset.Plugins.INWN2Plugin.Startup
        menu = cHost.GetMenuForPlugin(Me)
        AddHandler menu.Activate, AddressOf Me.LaunchPlugin
    End Sub

    Public Sub Unload(ByVal cHost As NWN2Toolset.Plugins.INWN2PluginHost) Implements NWN2Toolset.Plugins.INWN2Plugin.Unload

    End Sub

    Private Sub LaunchPlugin(ByVal Sender As Object, ByVal e As EventArgs) Handles menu.Activate
        If bInit Then
            bInit = False
            Dim form As frmStatus = New frmStatus            
            form.Show()
            form.Convert()
        Else
            bInit = True
        End If
    End Sub

    Public ReadOnly Property PluginMenuItem() As TD.SandBar.MenuButtonItem Implements NWN2Toolset.Plugins.INWN2Plugin.PluginMenuItem
        Get
            Return menu
        End Get
    End Property
End Class
